home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pas_0493.zip / ANSI-PAS.TXT < prev    next >
Text File  |  1993-04-22  |  2KB  |  57 lines

  1. ─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 323 of 474                                                               
  3. From : Mark Ouellet                        1:240/20.4           09 Apr 93  20:37 
  4. To   : Pat Jankowski                                                             
  5. Subj : Pascal & ANSI                                                          
  6. ────────────────────────────────────────────────────────────────────────────────
  7.     On 05 Apr 93 , you, Pat Jankowski, of 1:280/317.0 wrote...
  8.  
  9.  PJ> How would I get my Pascal program to display ANSI menus?  I 
  10.  PJ> don't want to fool around with the setforeground and background colors.  
  11.  PJ> I would rather have it just display a file.  How would I do this? 
  12.  
  13.     RULE 1
  14.         if you use the CRT unit anywhere in your main program or if any
  15.         of the units you use use it, then you need to reinstate
  16.         redirectability so that normal screen output goes through DOS
  17.         rather than being handled by TP.
  18.  
  19.         for that add these 4 lines at the start of your program:
  20.  
  21.             Assign(Input, '');   {Reassign Input to Standard Input}
  22.             Assign(OutPut, '');  {Reassign Output to Standard OutPut}
  23.             Reset(Input);        {Reopen it for reading}
  24.             Rewrite(OutPut);     {Reopen it for writing}
  25.  
  26.     RULE 2
  27.         if you don't use the CRT unit anywhere in your program then you
  28.         might have to add this command to your program:
  29.  
  30.             DirectVideo := False;
  31.  
  32.         I'm not sure about this one, I think it redirects video I/O
  33.         through BIOS rather than DOS or Vice-Versa.
  34.  
  35.  
  36.     RULE 3
  37.         Ansi.sys or an equivalent ANSI driver needs to be present in the
  38.         machine. Either loaded from config.sys if a .SYS file, loaded
  39.         from Autoexec.bat or Config.sys if .COM or .EXE file. (Some
  40.         .EXE/.COM files are actually device drivers loadable from
  41.         config.sys)
  42.  
  43.     That's all there is to it. Just read your menu file as normal text
  44.     and simply write it out to screen. Ansi.sys will take care of the
  45.     rest. If you need to output ANSI colored text from your program
  46.     simply include the ANSI sequence needed in the write string.
  47.  
  48.         Example: To clear the screen simply do a:
  49.  
  50.             write(#27,'[2J');
  51.  
  52.         This writes an <ESC>[2J= Ansi clear screen command.
  53.             <ESCAPE>=(#27)
  54.  
  55.         Best regards,
  56.         Mark Ouellet.
  57.